package com.seadragon.app.ksr.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

//@AnalyzerDef(name = "reviewanalyzer", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class))
//@Indexed(index = "Review")
@Entity
@Table(name = "REVIEW", schema="STAGING")
public class Review {
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "REVIEWIDSEQ")
	@SequenceGenerator(name = "REVIEWIDSEQ", sequenceName = "STAGING.REVIEW_ID_SEQ", schema="STAGING")	
	private long id;

	@Column
//	@Field(index = Index.YES, analyze = Analyze.YES, store=Store.NO) 
	private String title;
	
	@Column(name="CONTENT")
//	@Field(index = Index.YES, analyze = Analyze.YES, store=Store.NO) 
	private String content;
	
	@Column(name="RATING")
//	@Field(index = Index.YES, analyze = Analyze.NO, store=Store.NO) 
	private int rating;
	
	@Column(name="DATE_CREATED")
	@Temporal(TemporalType.TIMESTAMP) 
//	@Field(index = Index.YES, analyze = Analyze.NO) 
//	@DateBridge(resolution = Resolution.MONTH)
	private Date dateCreated;
	
	@Column(name="DATE_UPDATED")
	@Temporal(TemporalType.TIMESTAMP) 
	private Date dateUpdated;
	
	@ManyToOne
	@JoinColumn(name="CUSTOMER_ID")
	private Customer customer;
	
	@ManyToOne
	@JoinColumn(name="OFFICE_ID")
	private Office office;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getRating() {
		return rating;
	}

	public void setRating(int rating) {
		this.rating = rating;
	}

	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}

	public Date getDateUpdated() {
		return dateUpdated;
	}

	public void setDateUpdated(Date dateUpdated) {
		this.dateUpdated = dateUpdated;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Office getOffice() {
		return office;
	}

	public void setOffice(Office office) {
		this.office = office;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
}
